Skip to content

feat(auth)!: return pagination info and lazy iterators from admin list_users - #2102

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2739-auth-list-users-pagination
Nov 17, 2026
Merged

spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2739-auth-list-users-pagination

Conversation

@spydon

@spydon spydon commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

admin.list_users() now returns the page together with next_page, last_page and total, and the admin clients can iterate over every user lazily.

  • list_users() returns UserList (users, aud, plus Pagination) instead of list[User]. Breaking, see MIGRATION.md.
  • New SyncSupabaseAuthAdmin.iter_users() and AsyncSupabaseAuthAdmin.aiter_users() fetch one page at a time.
  • Link header parsing is shared with oauth.list_clients() and reads page from the query instead of splitting on page=.

SDK-2739

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Admin user listings now include pagination details alongside the users returned for the requested page.
    • Added synchronous and asynchronous iterators that fetch users page by page, with lazy retrieval.
  • Documentation
    • Updated the migration guide with the new paginated response format and guidance for using the iterators.

list_users() now returns a UserList with pagination metadata. The shared pagination validator reads total-count and link headers, and OAuth client listing uses it. Sync and async admin clients provide lazy page-by-page user iterators. The migration guide and SDK compliance entry document the response shape and iterator methods. Tests cover pagination metadata, iteration behavior, and updates to existing user-listing checks.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant SyncSupabaseAuthAdmin
  participant _validate_paginated_model
  Caller->>SyncSupabaseAuthAdmin: Iterate users with per_page
  loop Each page
    SyncSupabaseAuthAdmin->>SyncSupabaseAuthAdmin: Call list_users with page and per_page
    SyncSupabaseAuthAdmin->>_validate_paginated_model: Validate response and pagination headers
    _validate_paginated_model-->>SyncSupabaseAuthAdmin: Return UserList with pagination metadata
    SyncSupabaseAuthAdmin-->>Caller: Yield users
  end
Loading

Change: Feature

Merge Risk: Minimal · up to f7f64

admin.list_users() now returns a UserList with pagination metadata, and new iterators fetch users page by page. The breaking change is documented in the migration guide. No actionable merge-blocking risk was identified.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 42474649-18ce-4a6c-b963-ca4f2ed73dd7
Commits

Reviewing files that changed from the base of the PR and between 91aa96e and f7f6456.

Files selected for processing: 10

  • MIGRATION.md
  • sdk-compliance.yaml
  • src/auth/scripts/run-unasync.py
  • src/auth/src/supabase_auth/admin_api.py
  • src/auth/src/supabase_auth/helpers.py
  • src/auth/src/supabase_auth/types.py
  • src/auth/tests/_async/test_gotrue_admin_api.py
  • src/auth/tests/_async/test_list_users.py
  • src/auth/tests/_sync/test_gotrue_admin_api.py
  • src/auth/tests/_sync/test_list_users.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@spydon
spydon merged commit 7388531 into main Nov 17, 2026
26 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-2739-auth-list-users-pagination branch November 17, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant